home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1990 February
/
1990-02.d64
/
sound sampler
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
4KB
|
129 lines
10 rem copyright 1990 compute! publications, inc. - all rights reserved
20 print"[147]"tab(12)"copyright 1990":printtab(6)"compute! publications, inc."
30 printtab(10)"all rights reserved"
40 forjf=1to2500:next
50 data 4,14,24,34
60 data 3,5,7,9,11,13,15,17,19,21
70 for q=1to4:readx:cr(q)=x:next
80 for q=1to10:readx:lr(q)=x:next
90 dimz(4,10)
100 poke53281,0:poke53280,14
110 print"[147] sound sampler 64"
120 print:print"voice #1 [150]voice #2 [129]voice #3 [159]all 3"
130 print"[158]"
140 datafrhi,frlo,pulo,puhi,wvfm,atak,dcay,sust,rels,play
150 forq=1to10:readx$:forq2=1to3:printx$;" ";:nextq2:print:print:nextq
160 dataclr ,vol ,filo,fihi,reso,fivo,fity,play
170 forq=1to8:poke214,lr(q):print:poke211,cr(4):readx$:print"[157][157][157][157]"x$:nextq
180 print"[155]"
190 s=54272:forq=0to24:pokes+q,0:nextq:forq=1to4:forq2=1to10:z(q,q2)=0
200 next:next
210 forc=1to3:forl=1to10:poke214,lr(l):print:poke211,cr(c):printz(c,l);"[157] "
220 next:next
230 forq=1to8:poke214,lr(q):print:poke211,cr(4):print0;"[157] ":next
240 print:print"press f1 to print";
250 c=1:l=1
260 rem ** movement loop **
270 poke214,lr(l):print:poke211,cr(c):print""z(c,l)"[157] [146]";:poke211,cr(c)
280 js=peek(56320)
290 geta$:ifa$=chr$(133)then1030:rem print
300 ifjs=127then280
310 ifjs=111thenpoke53280,7:forjs=0to199:next:goto450
320 print"[146]"z(c,l);"[157] "
330 ifjs=126thenl=l-1:rem up
340 ifjs=125thenl=l+1:rem down
350 ifjs=123thenc=c-1:rem left
360 ifjs=119thenc=c+1:rem right
370 ifl>10thenl=10
380 ifl<1thenl=1
390 if(c=4)and(l>8)thenl=8
400 ifc<1thenc=1
410 ifc>4thenc=4
420 if(l>8)and(c>3)thenc=3
430 goto270
440 rem ** change loop **
450 ifc=4then870
460 ifl=1thenm=s+1:f=0:t=255:goto560
470 ifl=2thenm=s:f=0:t=255:goto560
480 ifl=3thenm=s+2:f=0:t=255:goto560
490 ifl=4thenm=s+3:f=0:t=15:goto560
500 ifl=5then680
510 ifl=6thenm=s+5:f=2:p=z(c,7):t=15:goto560
520 ifl=7thenm=s+5:f=1:p=z(c,6):t=15:goto560
530 ifl=8thenm=s+6:f=2:p=z(c,9):t=15:goto560
540 ifl=9thenm=s+6:f=1:p=z(c,8):t=15:goto560
550 ifl=10then820
560 js=peek(56320)
570 ifjs=127then560
580 ifjs=125thenz(c,l)=z(c,l)-1:goto620
590 ifjs=126thenz(c,l)=z(c,l)+1:goto620
600 ifjs=111thenpoke53280,14:forjs=0to199:next:goto260
610 goto560
620 ifz(c,l)>tthenz(c,l)=0:poke211,cr(c):print" ";:goto640
630 ifz(c,l)<0thenz(c,l)=t:goto640
640 iff=0thenpokem+(c-1)*7,z(c,l):goto670
650 iff=1thenpokem+(c-1)*7,p+z(c,l):goto670
660 iff=2thenpokem+(c-1)*7,p+z(c,l)*16
670 poke211,cr(c):print"";z(c,l);"[157] [146] ";:goto560
680 rem ** waveform change **
690 js=peek(56320)
700 ifjs=127then690
710 ifjs=125then750
720 ifjs=126then780
730 ifjs=111thenpoke53280,14:forjs=0to199:next:goto270
740 goto690
750 ifz(c,l)=0thenz(c,l)=128:goto770
760 z(c,l)=z(c,l)/2:ifz(c,l)<16thenz(c,l)=0
770 pokes+4+(c-1)*7,z(c,l):poke211,cr(c):print"";z(c,l);"[157] [146] ";:goto680
780 ifz(c,l)=0thenz(c,l)=16:goto810
790 z(c,l)=z(c,l)*2
800 ifz(c,l)>128thenz(c,l)=0:poke211,cr(c):print"";z(c,l);"[157] [146] ";
810 pokes+4+(c-1)*7,z(c,l):poke211,cr(c):print"";z(c,l);"[157] [146] ";:goto680
820 poke53280,14:rem play a voice
830 ifz(c,l)=0thenpokes+4+(c-1)*7,z(c,5)+1:goto860
840 pokes+4+(c-1)*7,z(c,5):z(c,l)=0:poke211,cr(c):print"";z(c,l);"[157] [146]";
850 goto260
860 z(c,l)=1:poke211,cr(c):print"";z(c,l);"[157] [146]";:goto260
870 rem ** all voices column **
880 ifl=1thenpoke53280,14:goto190
890 ifl=2thenm=s+3:f=1:p=z(c,7):t=15:goto560
900 ifl=3thenm=s:f=0:t=7:goto560
910 ifl=4thenm=s+1:f=0:t=255:goto560
920 ifl=5thenm=s+2:f=2:p=z(c,6):t=15:goto560
930 ifl=6thenm=s+2:f=1:p=z(c,5):t=7:goto560
940 ifl=7then1190:rem else play all voices
950 poke214,lr(10):print:forg=0to2:pokes+4+g*7,z(g+1,5):poke211,cr(g+1)
960 print0"[157] ";:z(g+1,10)=0:next
970 ifz(c,l)=1thenz(c,l)=0:poke214,lr(8):print:goto990
980 goto1000
990 poke211,cr(c):print"";z(c,l);"[157] [146] ";:poke53280,14:goto260
1000 poke214,lr(10):print:forg=0to2:pokes+4+g*7,z(g+1,5)+1:poke211,cr(g+1)
1010 print1;"[157] ";:z(g+1,10)=1:next
1020 poke214,lr(8):print:z(c,l)=1:goto990
1030 rem print it
1040 print"[147]":input"enter title:";y$(0):print
1050 input"enter name of voice 1:";y$(1)
1060 print:input"enter name of voice 2:";y$(2)
1070 print:input"enter name of voice 3:";y$(3)
1080 print:print"printing..."
1090 open4,4:print#4,"sound sample: ";y$(0):print#4,""
1100 print#4,"s=54272. reg's given in 's+' notation:"
1110 forn=1to3:print#4,y$(n):forn2=0to4:print#4,(n-1)*7+n2;": ";z(n,n2+1)
1120 nextn2:print#4,5+(n-1)*7;": ";z(n,6)*256+z(n,7)
1130 print#4,6+(n-1)*7;": ";z(n,8)*256+z(n,9):nextn
1140 print#4,"":print#4,21;": ";z(4,3)
1150 print#4,22;": ";z(4,4)
1160 print#4,23;": ";z(4,5)+z(4,6)
1170 print#4,24;": ";z(4,2)+z(4,7)*16
1180 close4:print"done!":end
1190 rem adjust filter type
1200 js=peek(56320):ifjs=127then1200
1210 ifjs=111thenpoke53280,14:forjs=0to199:next:goto270
1220 ifjs=125thenz(c,l)=z(c,l)-1:goto1250
1230 ifjs=126thenz(c,l)=z(c,l)+1:goto1250
1240 goto1200
1250 ifz(c,l)>7thenz(c,l)=0
1260 ifz(c,l)<0thenz(c,l)=7
1270 pokes+24,z(c,2)+z(c,l)*16:poke211,cr(c):print"";z(c,l);"[157] [146] ";
1280 goto1200